<?php
class Response {
    const RESPONSE_TYPE_GENERAL_ERROR = 100;
    const RESPONSE_TYPE_ERROR_USER_NOT_SET = 101;
    const RESPONSE_TYPE_ERROR_GAME_NOT_SET = 102;
    const RESPONSE_TYPE_ERROR_COMMAND_NOT_SET = 103;
    const RESPONSE_TYPE_ERROR_NEW_USER_FLAG_NOT_SET = 104;

    const RESPONSE_TYPE_OK = 200;

    const RESPONSE_FORMAT_JSON = "json";
    const RESPONSE_FORMAT_XML = "xml";

    public $responseType;
    public $responseMessage;

    public function __construct(){
        $this->responseType = 0;
        $this->responseMessage = "";
    }

    public function getResponseObject($type){
        $responseObject = "";
        switch($type){
            case Response::RESPONSE_FORMAT_JSON:
                $responseObject = json_encode($this);
                break;
            case Response::RESPONSE_FORMAT_XML:
                break;
            default:
                break;
        }

        return $responseObject;
    }
}